<template>
  <div class="bottom-bar">
    <div class="footbar-icons">
      <div>
        <span class="shop"></span>
        <div>店铺</div>
      </div>
      <div>
        <span class="message"></span>
        <div>客服</div>
      </div>
      <div>
        <span class="star"></span>
        <div>收藏</div>
      </div>
    </div>
    <div class="footbar-btns">
      <div @click="addCart">加入购物车</div>
      <div>立即购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "detail-bottom-bar",
  methods: {
    addCart() {
      this.$emit("addToCart");
    }
  }
};
</script>

<style scoped>
.bottom-bar {
  height: 49px;
  background: #fff;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  text-align: center;
}
.bottom-bar > div {
  flex: 1;
}
.footbar-icons {
  display: flex;
  font-size: 12px;
}
.footbar-icons span {
  display: inline-block;
  width: 19px;
  height: 19px;
  background-image: url(../../../assets/img/detail/detail_bottom.png);
  background-repeat: no-repeat;
  background-size: 100% auto;
  margin-bottom: 3px;
}
.footbar-icons > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.shop {
  background-position: 0 -85px;
}
.footbar-icons :nth-child(2) {
  border-left: 1px solid #f6f6f6;
  border-right: 1px solid #f6f6f6;
}
.message {
  background-position: 0 -45px;
}
.footbar-btns {
  display: flex;
  line-height: 49px;
  font-size: 16px;
}
.footbar-btns > div {
  flex: 1;
}
.footbar-btns :first-child {
  color: #ff5777;
  background-color: #ffe6e8;
}
.footbar-btns :last-child {
  color: #fff;
  background: -webkit-linear-gradient(left, #ff5777, #ff468f);
  background: linear-gradient(90deg, #ff5777, #ff468f);
}
</style>